package com.xmkj.jijidriver;

import android.content.Context;

import com.common.carbean.XiCheListBean;
import com.common.jiji.entity.JJOrderListBean;
import com.common.widget.recyclerview.refresh.adapter.CommonAdapter;
import com.common.widget.recyclerview.refresh.adapter.ViewHolder;

import java.util.List;

/**
 * Created by chen on 2018/4/7.
 */

public class OrderAdapter extends CommonAdapter<JJOrderListBean.ResultBean> {
    public OrderAdapter(Context context, List<JJOrderListBean.ResultBean> data) {
        super(context, data);
    }

    @Override
    protected void convert(ViewHolder holder, JJOrderListBean.ResultBean item, int position) {
        holder.setText(R.id.tv_name, item.orderType);
//        holder.setText(R.id.tv_info, item.brand + " " + item.model + " " + item.carnum);
        holder.setText(R.id.tv_number, item.phone);
        holder.setText(R.id.tv_location, item.beginAddr);
//        holder.setText(R.id.tv_name, item.nickname);

        holder.setOnClickListener(R.id.tv_number, new OnItemChildClickListener());
        holder.setOnClickListener(R.id.tv_location, new OnItemChildClickListener());
        holder.setOnClickListener(R.id.rl_details, new OnItemChildClickListener());
    }

    @Override
    protected int getItemViewLayoutId(int position, JJOrderListBean.ResultBean item) {
        return R.layout.item_order;
    }
}
